﻿using System.Collections.Generic;
using System.Linq;

namespace Kaiser.Domains
{
    public class PagedDomainList<TDomain> :PagedModel, IPagedDomainList<TDomain>
        where TDomain :class
    {
     

        public PagedDomainList(int total=0, int size=20, int current=1, IList<TDomain> list=null)
            : base(total, size, current)
        {
            Items = list ?? new List<TDomain>();
        }

        public TDomain FirstItem {
            get { return Items.FirstOrDefault(); }
        }

        public TDomain LastItem {
            get { return Items.LastOrDefault(); }
        }

        public IList<TDomain> Items { get; private set; }
    }
}